import { createStore, createLogger } from 'vuex'
import user from './modules/user'
import cart from './modules/car'
import category from './modules/category'
import createPersistedstate from 'vuex-persistedstate'

export default createStore({
  // 开启严格模式
  // strict: true,
  state: {},
  getters: {},
  mutations: {},
  actions: {},
  modules: {
    user,
    cart,
    category
  },
  plugins: [
    // 不产参数则存所有
    createPersistedstate({
      key: 'rabbit', // 存储的键值
      paths: ['user', 'cart'] // 指定存储的数据
    }),
    // 自动在控制台打印log日志=》修改vuex的状态
    createLogger()
  ]
})
